package com.test.xshang.pattern.factory.simple;

import com.test.xshang.pattern.factory.entity.DellMouse;
import com.test.xshang.pattern.factory.entity.HpMouse;
import com.test.xshang.pattern.factory.entity.Mouse;

/**
 * @BelongsProject: simpleframework
 * @BelongsPackage: com.Xshang.pattern.factory.simple
 * @Author: xshang
 * @CreateTime: 2023-06-23  18:37
 * @Description: TODO
 * @Version: 1.0
 */
public class MouseFactory {

    public static Mouse creatMouse(int type) {
        switch (type) {
            case 0:
                return new HpMouse();
            case 1:
            default:
                return new DellMouse();
        }

    }

    public static void main(String[] args) {
        Mouse mouse = MouseFactory.creatMouse(0);
        mouse.sayHi();
    }
}
